package tedu.week04.day03_generic;

/**
 * <pre>
 *      泛型的认识.
 * </pre>
 *
 * @author : resty
 * @date : 2019年07月09日    16时
 **/
public class Demo {
    public static void main(String[] args){
        GenericTest gt = new GenericTest();
        gt.setX(10);
        gt.setY(20);
        int x = (int) gt.getX();
        int y = (int) gt.getY();
        System.out.println("坐标值为x:"+x+" y:"+y);
    }
}

class GenericTest {
    private Object x;
    private Object y;
    //getter/setter方法略

    public Object getX() {
        return x;
    }

    public void setX(Object x) {
        this.x = x;
    }

    public Object getY() {
        return y;
    }

    public void setY(Object y) {
        this.y = y;
    }
}